#include <iostream>

using namespace std;
int main()
{
	int n;
	unsigned long long sum = 1;
	unsigned long long result = 0;
	cin >> n;
	for(int i = n;i>0;i--){
		sum = 1;
		for(int j = 1;j<=i;j++){
			sum = sum * j;
		}
		result = result + sum;
	}
	cout << result <<endl;
	
	return 0;
}
